<template>
<div class="content">
   <Input v-model="name" placeholder="请输入访客姓名" style="width: 90%;margin-top: 10px"></Input>
   <Input v-model="id" placeholder="请输入访客身份证" style="width: 90%;margin-top: 10px"></Input>
   <Input v-model="mobile" placeholder="请输入访客手机号码" style="width: 90%;margin-top: 10px"></Input>
  <Select v-model="category" class="select">
    <Option v-for="item in categoryList" :value="item.value" :key="item.value">{{ item.label }}</Option>
  </Select>
   <Input v-model="address" placeholder="请输入访客常住地址" style="width: 90%;margin-top: 10px"></Input>
   <Input v-model="company" placeholder="请输入访客公司名称" style="width: 90%;margin-top: 10px"></Input>
</div>
</template>

<script>
    import {getuserforminfo} from "../api/api";

    export default {
        name: "Userinfo",
        data(){
          return{
            name:null,
            mobile:null,
            id:null,
            category:null,
            address:null,
            company:null,
            categoryList: [
              {
                value: '个人贷款',
                label: '个人贷款'
              },
              {
                value: '企业贷款',
                label: '企业贷款'
              },
              {
                value: '小额贷款',
                label: '小额贷款'
              }
            ],
          }
        },
      mounted() {
        var self = this;
        let formId = localStorage.getItem('formid');
        getuserforminfo(formId).then(function (resp) {
          if (resp.data.code == 200){
             console.log(resp.data);
             var result = resp.data.data;
             self.name = result.name;
             self.mobile = result.mobile;
             self.id = result.ID;
             self.address = result.address;
             self.company = result.company;
             self.address = result.address;
             self.category = result.productCategory;
          }
        }).catch(function (error) {
        });
      }
    }
</script>

<style scoped>

  .content{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    width:550px;
    height:280px;
    background:rgba(255,255,255,1);
    box-shadow:5px 7px 49px 5px rgba(44,137,234,0.13);
  }

  .select{
    width: 90%;
    margin-top: 10px;
  }

</style>
